home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / xshp15.zip / INITFIX.C < prev    next >
Text File  |  1992-01-07  |  882b  |  27 lines

  1. /* Set up basic data that needs to be in fixed point, to avoid data
  2.    definition hassles. */
  3. #include "polygon.h"
  4.  
  5. /* All vertices in the basic cube */
  6. static IntPoint3 IntCubeVerts[NUM_CUBE_VERTS] = {
  7.    {15,15,15},{15,15,-15},{15,-15,15},{15,-15,-15},
  8.    {-15,15,15},{-15,15,-15},{-15,-15,15},{-15,-15,-15} };
  9. /* Transformation from world space into view space (no transformation,
  10.    currently) */
  11. static int IntWorldViewXform[3][4] = {
  12.    {1,0,0,0}, {0,1,0,0}, {0,0,1,0}};
  13.  
  14. void InitializeFixedPoint()
  15. {
  16.    int i, j;
  17.  
  18.    for (i=0; i<3; i++)
  19.       for (j=0; j<4; j++)
  20.          WorldViewXform[i][j] = INT_TO_FIXED(IntWorldViewXform[i][j]);
  21.    for (i=0; i<NUM_CUBE_VERTS; i++) {
  22.       CubeVerts[i].X = INT_TO_FIXED(IntCubeVerts[i].X);
  23.       CubeVerts[i].Y = INT_TO_FIXED(IntCubeVerts[i].Y);
  24.       CubeVerts[i].Z = INT_TO_FIXED(IntCubeVerts[i].Z);
  25.    }
  26. }
  27.